require 'weborb/context'
require 'rbconfig'


class RideService < BaseService
  
  def getRides()
    rides = Ride.find(:all, :conditions => "user_id = '" + getUserId() + "'")
  end
  
  def createRide(ride)
    new_ride = Ride.new(ride)
    new_ride.user_id = getUserId()
    new_ride.save
    new_ride
  end
  
  def updateRide(id, ride)
    @update_ride = Ride.find(id)
    @update_ride.update_attributes(ride)
    ride
  end
  
  def deleteRide(id)
    @delete_ride = Ride.find(id)
    @delete_ride.destroy
  end
  
end